//
//  NewMainCell.m
//  Doctor1.0
//
//  Created by mk on 15/11/2.
//  Copyright (c) 2015年 cocoa-mk. All rights reserved.
//

#import "NewMainCell.h"

@implementation NewMainCell

- (void)awakeFromNib {
    // Initialization code
    
    imageIcon.layer.masksToBounds = YES;
    imageIcon.layer.cornerRadius = imageIcon.width/2.0f;
    
    btnyuyue.layer.masksToBounds = YES;
    btnyuyue.layer.cornerRadius = 4;
    
}


-(void)fileDoctorDataWithDic:(Doctor *)dicData
{
    [imageIcon sd_setImageWithURL:dicData.imageUrl placeholderImage:loadDoctorImageDefaule];
    labName.text = dicData.name;
    labTitle.text = [NSString stringWithFormat:@"%@/%@",dicData.mTitle,dicData.aTitle];//职称
    labHospital.text = dicData.hpName;//医院
    
    if (dicData.hpDeptName.length>0)
    {
      [btnDepartment setBackgroundImage:[[UIImage imageNamed:@"main_doctor_keshi_btn_bg.png"] stretchableImageWithLeftCapWidth:6 topCapHeight:5] forState:UIControlStateNormal];
      [btnDepartment setTitle:dicData.hpDeptName forState:UIControlStateNormal];
      btnDepartment.hidden = NO;
        
    }else
    {
       btnDepartment.hidden = YES;
    }
   
    //btnyuyue.hidden = (dicData.actionUrl.length==0);
    
}


-(IBAction)btnclcik:(id)sender
{
    if ([self.celldelegate respondsToSelector:@selector(clickMakeAnAppointmentDoctorWithCell:)])
    {
        [self.celldelegate clickMakeAnAppointmentDoctorWithCell:self];
    }

}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
